#ifndef _COMMON_H_
#define _COMMON_H_

#include "gtmonitor.h"

#define FALSE       0
#define TRUE        1

#define PROC        "/proc"
#define STAT        "/proc/stat"
#define UPTIME      "/proc/uptime"
#define DISKSTATS   "/proc/diskstats"
#define MEMINFO     "/proc/meminfo"
#define DEVICES     "/proc/devices"
#define NETWORK     "/proc/net/dev"
#define SYSFS_BLOCK "/sys/block"
#define SYSFS_DEVCPU "/sys/devices/system/cpu"
#define SU_PATH     "/system/bin/su"
#define CACHE_PATH  "/cache"
#define SDCARD_PATH "/sdcard"
#define SYSTEM_PATH "/system"
#define DATA_PATH   "/data"
#define AC_ONLINE_PATH "/sys/class/power_supply/ac/online"
#define USB_ONLINE_PATH "/sys/class/power_supply/usb/online"
#define BATTERY_STATUS_PATH "/sys/class/power_supply/battery/status"
#define BATTERY_HEALTH_PATH "/sys/class/power_supply/battery/health"
#define BATTERY_CAPACITY_PATH "/sys/class/power_supply/battery/capacity"
#define BATTERY_TECHNOLOGY_PATH "/sys/class/power_supply/battery/technology"
#define BATTERY_VOLTAGE_PATH "/sys/class/power_supply/battery/batt_vol"
#define BATTERY_TEMPERATURE_PATH "/sys/class/power_supply/battery/batt_temp"


#define LOGGER_PATH "/sdcard/gtmonitor"

#define K_NODEV "nodev"

// system
#define RESERVED_SLOTS  4

// common
#define BUFFERSIZE      256


// storage
#define MAX_NAME_LEN    72
#define MAX_PF_NAME     1024
#define CNT_PART        0
#define CNT_USED_DEV    1
#define NR_DEV_PREALLOC 4
#define DISK_PREALLOC   4

// process
#define PROCESS_NAME_LEN 80
#define OWNER_NAME_LEN   80

#define S_VALUE(m,n,p)  (((double) ((n) - (m))) / (p) * HZ)

extern unsigned int hz;
#define HZ  hz

extern unsigned long long system_time;

extern unsigned long long get_interval(unsigned long long prev_uptime,
                unsigned long long curr_uptime);

//extern time_t get_localtime(struct tm *);

int get_HZ();

void swap_ll(long long *a, long long *b);

void swap_long(long *a, long *b);

void swap_ptr(void **a, void **b);

void swap_int(int *a, int *b);

void make_filename(char *buf);

#endif /* _COMMON_H_ */

